import http from "@/utils/http";

/**
 * 获取登录用户的地址列表
 */
export const getMembeAddress = () => {
  return http({ url: "/member/address" });
};

/**
 * 添加登录用户的地址列表
 * @param {Object} data 要添加登录用户的地址列表的数据
 */
 export const addMembeAddress = (data) => {
    return http({ url: "/member/address", method: "post", data });
};

/**
 * 获取收货地址详情
 * @param {String} id 查询该收货地址详情的id
 */
 export const getMembeAddressDetail = (id) => {
    return http({ url: `/member/address/${id}`,});
};

/**
 * 删除收货地址
 * @param {String} id 删除该收货地址的id
 */
 export const delMembeAddress = (id) => {
    return http({ url: `/member/address/${id}`, method: "delete"});
};

/**
 * 修改收货地址
 * @param {String} data 要修改的收货地址的data
 */
 export const updataMembeAddress = (data) => {
    return http({ url: `/member/address/${data.id}`, method: "put",data});
};